package top.wilbert.collegelink.message.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Date;

@Data
@TableName("chat_message")
public class ChatMessageEntity {

    //文本
    public static final int MESSAGE_TYPE_TEXT = 0;

    //图片
    public static final int MESSAGE_TYPE_IMAGE = 1;

    //信息id（自增）
    private Long messageId;

    //关系表id
    private Long linkId;

    //发送者id
    private Long fromUserId;

    //接收者id
    private Long toUserId;

    //内容
    private String content;

    //发送时间
    private Date sendTime;

    //消息类型  0--普通文本（默认）
    private int type = MESSAGE_TYPE_TEXT;

    //是否为最后一条
    private Boolean isLatest;

    @Override
    public String toString() {
        return "ChatMessageEntity{" +
                "messageId=" + messageId +
                ", linkId=" + linkId +
                ", fromUser='" + fromUserId + '\'' +
                ", toUser='" + toUserId + '\'' +
                ", content='" + content + '\'' +
                ", sendTime=" + sendTime +
                ", type=" + type +
                ", isLatest=" + isLatest +
                '}';
    }
}

